package com.chixing.day04.JiCheng;

/*父类*/
public class AccountInherit {
    public int accNo;   //账户账号
    public String accName;  //账户姓名
    private String accPassword;  //账户密码
    private long accTelno;  //账户手机号
    private float accBalance; //账户余额
    private int accType; //账户类型 0:储蓄账户, 1：信用账户


    public int getAccNo() {
        return accNo;
    }


    @Override
    public String toString() {
        return "AccountInherit{" +
                "accNo=" + accNo +
                ", accName='" + accName + '\'' +
                ", accPassword='" + accPassword + '\'' +
                ", accTelno=" + accTelno +
                ", accBalance=" + accBalance +
                ", accType=" + accType +
                '}';
    }

    public void setAccNo(int accNo) {
        this.accNo = accNo;
    }

    public AccountInherit() {
        this.accNo = accNo;
        this.accName = accName;
        this.accPassword = accPassword;
        this.accTelno = accTelno;
        this.accBalance = accBalance;
        this.accType = accType;
    }

    public String getAccName() {
        return accName;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public String getAccPassword() {
        return accPassword;
    }

    public void setAccPassword(String accPassword) {
        this.accPassword = accPassword;
    }

    public long getAccTelno() {
        return accTelno;
    }

    public void setAccTelno(long accTelno) {
        this.accTelno = accTelno;
    }

    public float getAccBalance() {
        return accBalance;
    }

    public void setAccBalance(float accBalance) {
        this.accBalance = accBalance;
    }

    public int getAccType() {
        return accType;
    }

    public void setAccType(int accType) {
        this.accType = accType;
    }

    //账户存款
    public void depoist(float money) {
        accBalance += money;
        System.out.println("存款成功！余额为:" + accBalance);
    }

    //账户取款
    public void withdraw(float money) {
        accBalance -= money;
        System.out.println("取款成功！余额为:" + accBalance);
    }
}
